package com.bss.dao;

import org.springframework.stereotype.Repository;

import com.andy.basics.Dao;
import com.bss.model.Bed;
import com.bss.model.BedBooking;

@Repository
public class BedBookingDao extends Dao<BedBooking> {

	@Override
	protected Class<BedBooking> getModelClass() {
		return BedBooking.class;
	}

	public BedBooking findCurrent(Bed bed) {
		return this.find("bed.id = " + bed.getId() + " and checkOutDate is not null").get(0);
	}
}
